home *** CD-ROM | disk | FTP | other *** search
- Path: Rezonet.net!altitude!usenet
- From: pifus@cam.org (David Taylor)
- Newsgroups: comp.lang.c++
- Subject: Re: Q: Good C++ UNDO Design
- Date: 31 Jan 1996 18:15:26 GMT
- Organization: Communications Accessibles Montreal
- Message-ID: <4eobju$roh@tandem.CAM.ORG>
- References: <4eit9g$c6j@news1.halcyon.com>
- NNTP-Posting-Host: pifus.hip.cam.org
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.6
-
- In article <4eit9g$c6j@news1.halcyon.com>, riston@coho.halcyon.com says...
- >
- >
- >I have been charged with designing an undo mechanism for a large graphical
- >Windows (32bit) application. This application is the classic 'draw a
- >shape' program (box, circle, line, OLE object, or whatever). I would like
- >to know if anybody has any elegant designs for handling undo operations. I
- >am working with Visual C++ 4.0 and MFC for the implementation. I
- >am well versed in C++.
- >
-
- I have no source code, but if you want to see how it should work from a
- users perspective check out the Describe wordprocessor (it's about $50).
- Instead of the usual Undo/Redo menu options, there is a dialog box with
- a slider bar which allows you to slide back and forth through
- the complete history of operations. Two ways I can see of doing this
- is make every operation reversible which is more complicated, or only
- keep a copy of the original document and apply the users instructions
- to it up to the current undo/redo level, which would be simple but slow.
- Either way you need some sort of stack of instructions, perhaps using
- an internal macro or symbolic language.
-
- Dave
-
-